<?php
class xl_contact{
    function read(){
        global $dbh;
        $sql='SELECT * FROM contact_info ORDER BY id DESC';
        $sth=$dbh->prepare($sql);
        $sth->execute();
        return $sth->fetchAll()[0];
    }
    function update($data){
        global $dbh;
        $sql='UPDATE contact_info SET tung_do=:tung_do,hoanh_do=:hoanh_do,title=:title,keyword=:keyword,description=:description,content=:content';
        $sth=$dbh->prepare($sql);
        $sth->execute($data);
        return $sth;
    }
}